#!/usr/local/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
import kernel.base.function as func
import os

class ConstError(Exception): pass
class _const(object):
    def __setattr__(self, k, v): 
        if k in self.__dict__:
            raise ConstError
        else:
            self.__dict__[k] = v 
            
conf = _const()
gadirs=os.path.normpath(os.path.join(os.getcwd(),os.path.dirname(__file__)))
conf.DODGE=0.0005
conf.AVOIDANCE=0.0005

conf.IP="192.168.1.100"
conf.POST=6502
conf.POLICY="config/policy.xml"
conf.MONGO_IP="58.64.177.195"
conf.GAMEDIR=os.path.join(gadirs,"../")
conf.MONGO_POST=27017
conf.MONGO_DB="movie"
#conf.MONGO_USER=False
#conf.MONGO_PWD=False
conf.MONGO_USER="mymovie"
conf.MONGO_PWD="pH65EYLJhb2vdnKL"
conf.PREE=1024



def get(key="IP"):
    if(func.is_arr(conf.__dict__, key)):
        return conf.__dict__[key]
    else:
        return False

    